package com.evan.kdl.test.day02;

import cn.hutool.core.date.StopWatch;
import com.evan.kdl.test.day02.service.ComparePriceService;
import com.evan.kdl.test.entity.PriceResultVo;

import java.util.Arrays;

/**
 * @author huangzhongliang
 * @time 2024/01/18 18:14
 */
public class ComparePriceDemo4 {
    public static void main(String[] args) {
        // 测试在一个平台比较同款产品(iPhone14)不同色系的价格
        //processed cost 1.07 second
        ComparePriceService service = new ComparePriceService();
        StopWatch sw = new StopWatch();
        sw.start();
        PriceResultVo priceResultVo = service.batchComparePrice(Arrays.asList("iPhone14黑色", "iPhone14白色", "iPhone14玫瑰红"));
        sw.stop();
        System.out.printf("processed cost %.2f second", sw.getTotalTimeSeconds());
        System.err.println("priceResultVo = " + priceResultVo);
    }
}
